<template>
  <el-breadcrumb :separator-icon="ArrowRight">
    <el-breadcrumb-item :to="{ path: '/index/indexabout' }">首页</el-breadcrumb-item>
    <el-breadcrumb-item  v-for="(item,index) in routelist" :key="index">{{item.meta.title}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>
<script>
import { ArrowRight } from "@element-plus/icons-vue";
export default {
  setup() {
    return {
      ArrowRight,
    };
  },
  data() {
    return {
      routelist: [],
    };
  },
  created() {
    this.routelist = this.$route.matched.slice(1);
    this.aa();
  },
  watch:{
    $route(){
      this.routelist = this.$route.matched.slice(1);//监听路由
    }
  },
  methods: {
    aa() {
      // this.routelist = this.$route.matched.slice(1);
      // console.log(this.$route.matched);
    },
  },
};
</script>